/******************************************************************************* * Copyright (c) 2012, Project: FP7-ICT-257930 Aniketos * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * - Neither the name of institution nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ /** */ package org.eclipse.dd.dc.util; import java.util.Map; import org.eclipse.dd.dc.*; import org.eclipse.emf.common.util.DiagnosticChain; import org.eclipse.emf.common.util.ResourceLocator; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.util.EObjectValidator; /** * <!-- begin-user-doc --> * The <b>Validator</b> for the model. * <!-- end-user-doc --> * @see org.eclipse.dd.dc.DcPackage * @generated */ public class DcValidator extends EObjectValidator { /** * The cached model package * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static final DcValidator INSTANCE = new DcValidator(); /** * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see org.eclipse.emf.common.util.Diagnostic#getSource() * @see org.eclipse.emf.common.util.Diagnostic#getCode() * @generated */ public static final String DIAGNOSTIC_SOURCE = "org.eclipse.dd.dc"; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Non negative size' of 'Font'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static final int FONT__NON_NEGATIVE_SIZE = 1; /** * A constant with a fixed name that can be used as the base value for additional hand written constants. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 1; /** * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT; /** * Creates an instance of the switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public DcValidator() { super(); } /** * Returns the package of this validator switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EPackage getEPackage() { return DcPackage.eINSTANCE; } /** * Calls <code>validateXXX</code> for the corresponding classifier of the model. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics, Map<Object, Object> context) { switch (classifierID) { case DcPackage.DOCUMENT_ROOT: return validateDocumentRoot((DocumentRoot)value, diagnostics, context); case DcPackage.BOUNDS: return validateBounds((Bounds)value, diagnostics, context); case DcPackage.FONT: return validateFont((Font)value, diagnostics, context); case DcPackage.POINT: return validatePoint((Point)value, diagnostics, context); default: return true; } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validateDocumentRoot(DocumentRoot documentRoot, DiagnosticChain diagnostics, Map<Object, Object> context) { return validate_EveryDefaultConstraint(documentRoot, diagnostics, context); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validateBounds(Bounds bounds, DiagnosticChain diagnostics, Map<Object, Object> context) { return validate_EveryDefaultConstraint(bounds, diagnostics, context); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validateFont(Font font, DiagnosticChain diagnostics, Map<Object, Object> context) { if (!validate_NoCircularContainment(font, diagnostics, context)) return false; boolean result = validate_EveryMultiplicityConforms(font, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryDataValueConforms(font, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(font, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(font, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryProxyResolves(font, diagnostics, context); if (result || diagnostics != null) result &= validate_UniqueID(font, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryKeyUnique(font, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(font, diagnostics, context); if (result || diagnostics != null) result &= validateFont_non_negative_size(font, diagnostics, context); return result; } /** * Validates the non_negative_size constraint of '<em>Font</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validateFont_non_negative_size(Font font, DiagnosticChain diagnostics, Map<Object, Object> context) { return font.non_negative_size(diagnostics, context); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validatePoint(Point point, DiagnosticChain diagnostics, Map<Object, Object> context) { return validate_EveryDefaultConstraint(point, diagnostics, context); } /** * Returns the resource locator that will be used to fetch messages for this validator's diagnostics. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public ResourceLocator getResourceLocator() { // TODO // Specialize this to return a resource locator for messages specific to this validator. // Ensure that you remove @generated or mark it @generated NOT return super.getResourceLocator(); } } //DcValidator